import request from '../utils/request'

export function createNews(news) {
  return request({
    url: '/news/createNews',
    method: 'post',
    data: news
  })
}

export function getOneNews(fileName) {
  return request({
    url: '/news/getOneNews',
    method: 'get',
    params: { fileName }
  })
}
export function updateNews(news) {
  return request({
    url: '/news/updateNews',
    method: 'post',
    data: news
  })
}

export function getNews(fileName) {
  return request({
    url: '/news/NewsList',
    method: 'get',
    params: { fileName }
  })
}

export function getCategory() {
  return request({
    url: '/news/NewsCategoryList',
    method: 'get'
  })
}

export function listNews(params) {
  return request({
    url: '/news/NewsList',
    method: 'get',
    params
  })
}

export function NewsListCategory(params) {
  return request({
    url: '/news/NewsListCategory',
    method: 'get',
    params
  })
}

export function deleteNews(id) {
  return request({
    url: '/news/deleteNews',
    method: 'get',
    params: { id }
  })
}

